package me.mcx.mcx.web.controller;

import me.mcx.common.annotation.Log;
import me.mcx.common.core.controller.BaseController;
import me.mcx.common.core.domain.AjaxResult;
import me.mcx.common.enums.BusinessType;
import me.mcx.mcx.domain.McxMessage;
import me.mcx.mcx.service.IMcxMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 消息信息Controller
 * 
 * @author mcx
 * @date 2024-09-22
 */
@RestController
@RequestMapping("/api/mcx/message")
public class ApiMcxMessageController extends BaseController
{
    @Autowired
    private IMcxMessageService mcxMessageService;

    /**
     * 新增消息信息
     */
    @Log(title = "消息信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody McxMessage mcxMessage)
    {
        return toAjax(mcxMessageService.insertMcxMessage(mcxMessage));
    }
}
